package com.gitee.jjnnzb.designpatterninspring.business.openapi.manager.impl;

import cn.hutool.core.util.IdUtil;
import com.gitee.jjnnzb.designpatterninspring.business.openapi.manager.MainTableInfoHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author Jjn
 * @since 2023/8/10 20:23
 */
@Service
@Slf4j
public class MainTableInfoHandlerImpl implements MainTableInfoHandler {
    @Override
    public void handleMainTable(Map<String, Object> map) {
        if (log.isInfoEnabled()) {
            log.info("处理主表信息，填充ID");
        }
        map.put("id", IdUtil.getSnowflakeNextId());
    }
}
